package com.beidasoft.web.util.enums;

/**
 * @Author songff
 * @MethodName
 * @Description //TODO 当事人检查对象枚举类
 * @Date 13:26 2020/3/28
 * @Param
 * @return citizenName 公民-姓名
 * selfEmployedName 个体工商户-名称
 * companyName  法人-单位名称
 * otherOrganCompanyName   非法人组织-名称
 * inspectionObject 处罚-检查对象
 **/
public enum CheckObjectEnum {
    CHECK_OBJECT_1("citizenName", "inspectionObject", "公民_姓名"),
    CHECK_OBJECT_2("selfEmployedName", "inspectionObject", "个体工商户_名称"),
    CHECK_OBJECT_3("companyName", "inspectionObject", "法人_名称"),
    CHECK_OBJECT_4("otherOrganCompanyName", "inspectionObject", "非法人组织_名称"),
    ;

    private String code;//检查案件-检查对象字段
    private String type;//处罚案件-检查对象字段
    private String name;

    public String getCode() {
        return code;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    CheckObjectEnum(String code, String type, String name) {
        this.code = code;
        this.type = type;
        this.name = name;
    }

    /**
     * @return java.lang.String
     * @Author songff
     * @MethodName getTypeByCode
     * @Description //TODO 通过检查案件的检查对象字段，获取处罚案件的检查对象字段
     * @Date 13:37 2020/3/28
     * @Param [code]
     **/
    public static String getTypeByCode(String code) {
        switch (code) {
            case "citizenName":
                return CHECK_OBJECT_1.type;
            case "selfEmployedName":
                return CHECK_OBJECT_2.type;
            case "companyName":
                return CHECK_OBJECT_3.type;
            case "otherOrganCompanyName":
                return CHECK_OBJECT_4.type;
            default:
                return null;
        }
    }
}
